package com.shangxia.monomer.common.util;

import com.alibaba.fastjson.JSONObject;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;


/**
 * @author zhouya38158
 * @Package com.shangxia.monomer.common.util.file
 * @date 2021/7/22 10:16
 */
public class NetworkingUtil {
    private static RestTemplate restTemplate = new RestTemplate();

    public static ResponseEntity<JSONObject> httpGet(String uri) {
        ResponseEntity<JSONObject> entity = restTemplate.getForEntity(uri, JSONObject.class);
        return restTemplate.getForEntity(uri, JSONObject.class);
    }

    public static JSONObject httpPost(String url, JSONObject job) {
        return restTemplate.postForObject(url, job, JSONObject.class);
    }
}
